/*
 * @Descripttion:
 * @version:
 * @Author: sueRimn
 * @Date: 2020-10-15 15:00:43
 * @LastEditors: sueRimn
 * @LastEditTime: 2020-11-24 11:33:06
 */
/**
 * 用户账号
 */
import request from "@/utils/request";
import store from "@/store/index";

// 夹带k_token
function addK_Token(data) {
    var token = {
        k_token: store.getters.k_token
    };
    Object.assign(data, token);
    return data;
}

export function getAccount(data) {
    return request({
        url: "/lessonUrl/login/account",
        method: "POST",
        headers: {},
        data
    });
}

/**
 * 获取token
 */
export function getToken(data) {
    return request({
        url: "/location_url/user/currency.user/Login",
        method: "POST",
        headers: {},
        data
    });
}

/**
 * 用户信息
 */
export function getUserInfo(data) {
    return request({
        url: "/location_url/user/currency.basic/GetUserInfo",
        method: "POST",
        headers: {},
        data
    });
}

/**
 * 获取限制验证码
 */
export function getVisCode() {
    return request({
        url: "/location_url/user/currency.user/GetVerification",
        method: "POST",
        headers: {},
        data: { times: new Date().getTime() }
    });
}

/**
 * 退出登录
 */
export function userLoginOut(data) {
    return request({
        url: "/location_url/user/currency.basic/UserLoginOut",
        method: "POST",
        headers: {},
        data
    });
}

/**
 * 修改用户信息
 */
export function updateUserBasic(data) {
    return request({
        url: "/location_url/user/currency.basic/UpdateBasic",
        method: "POST",
        headers: {},
        data: addK_Token(data)
    });
}
